package com.gz.hystrix.controller;

import com.gz.hystrix.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("api/hystrix/")
public class TestController {

    @Autowired
    private PaymentService paymentService;

    @GetMapping("ok")
    public String getOk(){
        return paymentService.getResultOk();
    }


    @GetMapping("out")
    public String getOut() throws InterruptedException {
        return paymentService.getResultTimeOut();
    }

}
